#ifndef FFMPEGEXTRA_EYERWASMINDEXEDDB_PUTEVENT_HPP
#define FFMPEGEXTRA_EYERWASMINDEXEDDB_PUTEVENT_HPP

#include "EyerWASMCommon/EyerWASMEvent.hpp"

namespace Eyer
{
    class EyerWASMIndexedDB_PutEvent : public EyerWASMEvent
    {
    public:
        EyerWASMIndexedDB_PutEvent(
                int indexedDBKey,
                const std::string & key,
                const uint8_t * buf,
                size_t bufSize,
                int64_t contentLength,
                int64_t rangeLength);

        ~EyerWASMIndexedDB_PutEvent();

        virtual int Run() override;

        int EyerWASMIndexedDB_PutEvent_Put_OnSucc();
        int EyerWASMIndexedDB_PutEvent_Put_OnFail();

    private:
        int m_indexedDBKey = 0;
        std::string m_key;
        uint8_t * m_buf = nullptr;
        size_t m_bufSize = 0;
        int64_t m_contentLength = 0;
        int64_t m_rangeLength = 0;
    };
}

#endif //FFMPEGEXTRA_EYERWASMINDEXEDDB_PUTEVENT_HPP
